package wicket.example.tableutils;

import java.io.Serializable;
import java.util.Map;

public class OccupancyColumnVisibilityTemlate implements Serializable {

	private static final long serialVersionUID = 1L;

	private String templateName;
	private Map<OccupancyColumn, Boolean> template = null;

	public OccupancyColumnVisibilityTemlate(String templateName,
			Map<OccupancyColumn, Boolean> template) {
		this.templateName = templateName;
		this.template = template;
	}

	public boolean isVisible(OccupancyColumn column) {
		if (!template.containsKey(column)) {
			throw new IllegalArgumentException(
					"Column does not contains in current template.");
		}
		return this.template.get(column);
	}

	public String getTemplateName() {
		return templateName;
	}

	public void setTemplateName(String templateName) {
		this.templateName = templateName;
	}

	public Map<OccupancyColumn, Boolean> getTemplate() {
		return template;
	}

	public void setTemplate(Map<OccupancyColumn, Boolean> template) {
		this.template = template;
	}

}
